/* Copyright 2009
 *
 * This program and the accompanying materials
 * are made available under the terms of the
 * Eclipse Public License v1.0 which accompanies
 * this distribution, and is available at
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in
 * writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
 * OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing
 * permissions and limitations under the License.
 *
 * Contributors:
 * 	   IBM Corporation - initial API and implementation for JDT/DLTK
 *     Sean W. Quinn - initial adoption for use with PHP from various sources.
 */
package org.eclipse.php.internal.formatter;

/**
 * A location maintains positional information both in original source and in the output source.
 * It remembers source offsets, line/column and indentation level.
 * @since 2.1
 */
public class Location {

	public int inputOffset;
	public int outputLine;
	public int outputColumn;
	public int outputIndentationLevel;
	public boolean needSpace;
	public boolean pendingSpace;
	public int nlsTagCounter;
	public int lastLocalDeclarationSourceStart;
	public int numberOfIndentations;

	// chunk management
	public int lastNumberOfNewLines;

	// edits management
	int editsIndex;
	OptimizedReplaceEdit textEdit;

	public Location(Scribe scribe, int sourceRestart){
		update(scribe, sourceRestart);
	}

	/**
	 *
	 * @param scribe
	 * @param sourceRestart
	 */
	public void update(Scribe scribe, int sourceRestart){
//		this.outputColumn = scribe.column;
//		this.outputLine = scribe.line;
//		this.inputOffset = sourceRestart;
//		this.outputIndentationLevel = scribe.indentationLevel;
//		this.lastNumberOfNewLines = scribe.lastNumberOfNewLines;
//		this.needSpace = scribe.needSpace;
//		this.pendingSpace = scribe.pendingSpace;
//		this.editsIndex = scribe.editsIndex;
//		this.nlsTagCounter = scribe.nlsTagCounter;
//		this.numberOfIndentations = scribe.numberOfIndentations;
//		this.textEdit = scribe.getLastEdit();
	}
}
